import { createApp } from 'vue'
/*引入element组件*/
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

/*引入element-icon组件*/
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

/*引入路由*/
import { router } from './router/index.js'

/*引入axios*/
import axios from 'axios'

import App from './App.vue'

const app = createApp(App)
    // 是否在启动时生成生产提示
    app.config.productionTip = false
    // 指定 axios 的全局配置，指定为后端服务器地址
    axios.defaults.baseURL = 'http://localhost:8080/'
    //定义图片地址全局变量，所有组件都可以使用
    app.config.globalProperties.$urlImage = 'http://localhost:8080/images/';

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

    app.use(ElementPlus)
    app.use(router)
    app.mount('#app')

